package com.mentaleye.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.mentaleye.dal.dao.LoanRecordDao;
import com.mentaleye.dal.model.LoanRecord;
import com.mentaleye.dal.model.LoanRecordExample;
import com.mentaleye.dal.service.LoanRecordMapper;

@Repository
public class LoanRecordDaoImpl implements LoanRecordDao {

	@Autowired private LoanRecordMapper recordMapper;
	
	@Override
	public boolean insertRecord(LoanRecord record) {
		boolean isSuccess=false;
		int result=this.recordMapper.insert(record);
		if(result>0)
		{
			isSuccess=true;
		}
		return isSuccess;
	}

	@Override
	public boolean updateByExample(LoanRecord record,LoanRecordExample example) {
		boolean isSuccess=false;
		int result=this.recordMapper.updateByExample(record, example);
		if(result>0)
		{
			isSuccess=true;
		}
		return isSuccess;
	}

	@Override
	public List<LoanRecord> getListByExample(LoanRecordExample example) {
		return this.recordMapper.selectByExample(example);
	}

	@Override
	public List<Map<String, Object>> getListByMap(Map<String, Object> map) {
		return this.recordMapper.getListByMap(map);
	}

	@Override
	public boolean deleteByExample(LoanRecordExample example) {
		boolean isSuccess=false;
		int result=this.recordMapper.deleteByExample(example);
		if(result>0)
		{
			isSuccess=true;
		}
		return isSuccess;
	}

}
